package com.gan.controller;

import com.gan.entity.Person;
import com.gan.service.PService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@RestController
@RequestMapping("/person")
public class PersonController {
 
    @Autowired
    private PService personService;
 
    @GetMapping("/findAll")
    public String findAll(){
        List<Person> personList = personService.findAll();
        return personList.toString();
    }
 
    @GetMapping("/hello")
    public String hello(){
        return "<h1 color='red'>Hello.gangan! v3.0版本</hello>";
    }
}